<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{baseui/head :: head}">
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content="动检通智慧云平台"/>
    <meta name="author" content="牧中(上海)物联网科技有限公司"/>
    <link rel="shortcut icon" href="/webjars/images/favicon.png"/>
    <link rel="stylesheet" href="/webjars/js/layui/css/layui.css" media="all">
    <title>牧中畜牧业大数据智慧云平台V1.0</title>


</head>
<style>
    th.ui-th-column div {
        white-space: normal !important;
        height: auto !important;
        padding: 0px;
    }

    .ui-jqgrid tr.jqgrow td {
        white-space: normal !important;
        height: auto;
    }
</style>
<body>
<!--顶部一级导航-->
<th:block th:replace="baseui/topheader :: topheader(1)"/>

<!--动检通菜单-->
<th:block th:replace="djt/partial/topnav :: topnav(10)"/>


<div id="cl-wrapper">
    <!--左边导航-->
    <th:block th:replace="djt/partial/reportFormLeft :: nav(3)"/>

    <div class="container-fluid" id="pcont">
        <!--<div class="page-head">-->
        <!--<h3>产地检疫日报表</h3>-->
        <!--</div>-->


        <div class="row">
            <div class="col-md-17">
                <div class="block-flat">
                    <div class="header"><h3>养殖档案报表</h3></div>
                    <div class="content">
                        <div class="table-responsive">
                            <div id="datatable_wrapper" class="form-inline dt-bootstrap">

                                <div class="row">

                                    <!-- search-->

                                    <div style="white-space: nowrap">
                                        <div class="row" style="width:1980px;margin-left: 30px">

                                            <div class="from-group">

                                                <div class="col-sm-1">
                                                    <div class="input-group date datetime col-md-4 col-xs-5"
                                                         data-min-view="2" data-date-format="yyyy-mm-dd">
                                                        <input id="start" class="form-control" style="width: 90px;"
                                                               size="16"
                                                               type="text" value="" placeholder="开始时间" readonly>
                                                        <span class="input-group-addon btn btn-primary"><span
                                                                class="glyphicon glyphicon-th"></span></span>
                                                    </div>
                                                </div>
                                                <div class="col-sm-1">
                                                    <div class="input-group date datetime col-md-4 col-xs-5"
                                                         data-min-view="2" data-date-format="yyyy-mm-dd">
                                                        <input id="end" class="form-control" style="width: 90px;"
                                                               size="16"
                                                               type="text" value="" placeholder="结束时间" readonly>
                                                        <span class="input-group-addon btn btn-primary"><span
                                                                class="glyphicon glyphicon-th"></span></span>
                                                    </div>
                                                </div>

                                                <span style="margin-left: 5px">   区域:
                                                    <select class="select2" style="max-width: 120px;"
                                                            id="city">
                                                        <option value="全部">所有区域</option>
                                                        <span th:each="cityAreaDto :${cityAreaDtoList}">
                                                        <optgroup th:label="${cityAreaDto.city}">
                                                            <span th:each="region :${cityAreaDto.regions}">
                                                                <option th:value="${region}"
                                                                        th:text="${region}"></option>
                                                            </span>
                                                        </optgroup>
                                                </span>
                                                </select>
                                                </span>
                                                <span style="margin-left: 10px">   畜禽:
                                                    <select class="select2" style="max-width: 120px;"
                                                            onchange="breedTypeSelected()" id="breedType">
                                                        <option value="-1">全部</option>
                                                        <option value="1">猪 </option>
                                                        <option value="2">牛 </option>
                                                        <option value="3">羊 </option>
                                                        <option value="4">家禽</option>
                                                    </select>

                                                </span>

                                                <!--<span style="visibility: hidden">   养殖场:-->
                                                <!--<select class="select2" id="factory">-->
                                                <!--<option value='-1' selected>所有养殖场</option>-->
                                                <!--<span th:each=" breedFactory :${breedFactoryList}">-->
                                                <!--<option th:text="${breedFactory.name}"-->
                                                <!--th:value="${breedFactory.id}">选项 1</option>-->
                                                <!--</span>-->
                                                <!--</select>-->
                                                <!--</span>-->
                                                <span style="margin-left: 40px">
                                                    <button class="btn btn-primary" onclick="SearchBtn()">搜索</button>
                                                </span>
                                                <span style="margin-left: 40px">
                                                    <button class="btn btn-primary"
                                                            onclick="GetReport()">导出报表</a></button>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-sm-21" style="width: 1980px;margin-left: 50px">

                                            <!-- Table -->
                                            <table id="jqGrid" style="height: auto"
                                                   class="ui-jqgrid tr.jqgrow td th.ui-th-column div"></table>
                                            <div id="jqGridPager"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>

</div>

<script type="text/javascript" src="/webjars/js/jquery.js"></script>

<script type="text/javascript" src="/webjars/js/jquery.nanoscroller/jquery.nanoscroller.js"></script>
<script type="text/javascript" src="/webjars/js/behaviour/general.js"></script>
<script src="/webjars/js/jquery.ui/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript" src="/webjars/js/jquery.nestable/jquery.nestable.js"></script>

<script type="text/javascript" src="/webjars/js/bootstrap.switch/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="/webjars/js/jquery.select2/select2.min.js" type="text/javascript"></script>

<script src="/webjars/js/bootstrap.slider/js/bootstrap-slider.js" type="text/javascript"></script>
<script type="text/javascript" src="/webjars/js/jquery.niftymodals/js/jquery.modalEffects.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.summernote/dist/summernote.min.js"></script>


<script type="text/javascript" src="/webjars/js/jquery.magnific-popup/dist/jquery.magnific-popup.min.js"></script>


<script src="/webjars/js/behaviour/voice-commands.js"></script>
<script src="/webjars/js/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/ecmascript" src="/webjars/jqgrid/js/i18n/grid.locale-cn.js"></script>
<script type="text/ecmascript" src="/webjars/jqgrid/js/jquery.jqGrid.min.js"></script>

<script src="/webjars/js/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript">
    var initDate;
    initDate = new Date();
    var params = {};
    $(document).ready(function () {

        App.init();
        //grid
        $("#jqGrid").jqGrid({
            url: '/djt/report/breedDocumentReportFormB',
            postData: params,
            mtype: "get",
            styleUI: 'Bootstrap',
            datatype: "json",
            autowidth: true,
            shrinkToFit: true,
            colModel: [
                {
                    label: '<span style="text-align: center">养殖场</span>',
                    name: 'breedFactoryName',
                    align: 'center',
                    color: '#36a3ff'
                },
                {
                    label: '<span style="text-align: center">养殖品种</span>',
                    name: 'breedType',
                    width: '90px',
                    align: 'center',
                    formatter: ShowBreeType
                },
                {
                    label: '<span style="text-align: center">变动存栏</span>',
                    name: 'sumProduction',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">详细</span>',
                    name: 'productionInfo',
                    align: 'center',
                    formatter: ShowOperatorProduction
                },
                {
                    label: '<span style="text-align: center">记录次数</span>',
                    name: 'countFeedReport',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">详细</span>',
                    name: 'feedReportInfo',
                    align: 'center',
                    formatter: ShowOperatorFeed
                },
                {
                    label: '<span style="text-align: center">总消费（元）</span>',
                    name: 'totalOfMaterialPurchase',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">明细</span>',
                    name: 'materialPurchaseReportInfo',
                    align: 'center',
                    formatter: ShowOperatorMaterial
                },
                {
                    label: '<span style="text-align: center">总消费（元）</span>',
                    name: 'totalOfDrugPurchase',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">明细</span>',
                    name: 'drugPurchaseReportInfo',
                    align: 'center',
                    formatter: ShowOperatorDrugPurchase
                },
                {
                    label: '<span style="text-align: center">总消费（元）</span>',
                    name: 'totalOfVaccinePurchase',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">明细</span>',
                    name: 'vaccinePurchaseReportInfo',
                    align: 'center',
                    formatter: ShowOperatorVaccineInfo
                },
                {
                    label: '<span style="text-align: center">总消费（元）</span>',
                    name: 'totalOfSeedPurchase',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">明细</span>',
                    name: 'seedPurchaseReportInfo',
                    align: 'center',
                    formatter: ShowOperatorSeedPurchase
                },
                {
                    label: '<span style="text-align: center">总消费（元）</span>',
                    name: 'totalOfOtherPurchase',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">明细</span>',
                    name: 'otherPurchaseReportInfo',
                    align: 'center',
                    formatter: ShowOperatorOtherPurchase
                },
                {
                    label: '<span style="text-align: center">免疫次数</span>',
                    name: 'countImmunizationRecord',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">详细</span>',
                    name: 'immunizationRecordInfo',
                    align: 'center',
                    formatter: ShowOperatorImmunization
                },
                {
                    label: '<span style="text-align: center">记录次数</span>',
                    name: 'countDisinfect',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">详细</span>',
                    name: 'disinfectReportInfo',
                    align: 'center',
                    formatter: ShowOperatorDisinfect
                },
                {
                    label: '<span style="text-align: center">记录次数</span>',
                    name: 'countDiagnosis',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">详细</span>',
                    name: 'diagnosisReportInfo',
                    align: 'center',
                    formatter: ShowOperatorDiagnosis
                },
                {
                    label: '<span style="text-align: center">记录次数</span>',
                    name: 'countImmunizationDetection',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">详细</span>',
                    name: 'immunizationDetectionReportInfo',
                    align: 'center',
                    formatter: ShowOperatorImmunizationDetection
                },
                {
                    label: '<span style="text-align: center">死淘数</span>',
                    name: 'sumQuarantineHarmless',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">详细</span>',
                    name: 'quarantineHarmlessInfo',
                    align: 'center',
                    formatter: ShowOperatorQuantineHarmless
                },
                {
                    label: '<span style="text-align: center">干粪利用量(kg)</span>',
                    name: 'sumOfDry',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">沼液利用量(吨)</span>',
                    name: 'sumOfLiquid',
                    align: 'center'
                },
                {
                    label: '<span style="text-align: center">备注</span>',
                    name: 'remark',
                    align: 'center'
                }
            ],
            viewrecords: true,
            height: 350,

            rowNum: 20,
            pager: "#jqGridPager"
        });
        $("#jqGrid").jqGrid('setGroupHeaders', {
            useColSpanStyle: true, // 没有表头的列是否与表头列位置的空单元格合并
            groupHeaders: [
                {
                    startColumnName: "sumProduction", //开始列
                    numberOfColumns: 4, //合并几列
                    titleText: "生产中心"//合并后父列名
                },
                {
                    startColumnName: "totalOfMaterialPurchase", //开始列
                    numberOfColumns: 10, //合并几列
                    titleText: "采购中心" //合并后父列名
                },
                {
                    startColumnName: "countImmunizationRecord", //开始列
                    numberOfColumns: 10, //合并几列
                    titleText: "防疫中心" //合并后父列名
                },
                {
                    startColumnName: "sumOfDry", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "治污中心" //合并后父列名
                }
            ]
        });
        $("#jqGrid").jqGrid('setGroupHeaders', {
            useColSpanStyle: true, // 没有表头的列是否与表头列位置的空单元格合并
            groupHeaders: [

                {
                    startColumnName: "sumProduction", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "生产记录"//合并后父列名
                },
                {
                    startColumnName: "countFeedReport", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "饲料记录" //合并后父列名
                },
                {
                    startColumnName: "totalOfMaterialPurchase", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "原料购置" //合并后父列名
                },
                {
                    startColumnName: "totalOfDrugPurchase", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "药物购置" //合并后父列名
                },
                {
                    startColumnName: "totalOfVaccinePurchase", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "疫苗购置" //合并后父列名
                },
                {
                    startColumnName: "totalOfSeedPurchase", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "引种记录" //合并后父列名
                },
                {
                    startColumnName: "totalOfOtherPurchase", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "其他购置" //合并后父列名
                },
                {
                    startColumnName: "countImmunizationRecord", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "免疫记录" //合并后父列名
                },
                {
                    startColumnName: "countDisinfect", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "消毒记录" //合并后父列名
                },
                {
                    startColumnName: "countDiagnosis", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "诊疗记录" //合并后父列名
                },
                {
                    startColumnName: "countImmunizationDetection", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "检验检测" //合并后父列名
                },
                {
                    startColumnName: "sumQuarantineHarmless", //开始列
                    numberOfColumns: 2, //合并几列
                    titleText: "无害化" //合并后父列名
                }
            ]
        });

    });

    function city() {

    }

    function breedTypeSelected() {
        var breedType = $("#breedType").val();

        var type = "猪";
        if (breedType === "1") {
            type = "猪";
        } else if (breedType === "2") {
            type = "牛";
        } else if (breedType === "3") {
            type = "羊";
        } else if (breedType === "4") {
            type = "家禽";
        }
    }

    function ShowBreeType(cellvalue, options, rowObject) {
        var type;
        switch (cellvalue) {
            case 1:
                type = "猪";
                break;
            case 2:
                type = "牛";
                break;
            case 3:
                type = "羊";
                break;
            case 4:
                type = "家禽";
                break;
        }
        return type;
    }

    //搜索
    function SearchBtn() {

        var time1 = $("#start").val();
        var time2 = $("#end").val();
        var breedType = $("#breedType").val();
        var area = $("#city").val();

        console.info(area);

        if (time1 === "") {
            time1 = new Date("2000-01-01 :00:00:00");
        } else {
            time1 = new Date(time1);
        }

        if (time2 === "") {
            time2 = new Date();
        } else {
            time2 = new Date(time2);
        }

        var sdata = {   // 构建查询需要的参数
            start: time1,
            end: time2,
            area: area,
            breedType: breedType
        };

        var postData = $("#jqGrid").jqGrid("getGridParam", "postData");

        $.extend(postData, sdata);

        $("#jqGrid").jqGrid("setGridParam", {

            // (6)将jqGrid的search选项设为true
            search: true

        }).trigger("reloadGrid", [{page: 1}]);   // (7)重新载入Grid表格，以使上述设置生效
    }

    function GetReport() {
        var time1 = $("#start").val();
        var start;
        var end;
        var time2 = $("#end").val();
        var breedType = $("#breedType").val();
        var area = $("#city").val();


        if (time1 === "") {
            time1 = initDate.getFullYear() + "-1-1";
            start = new Date(time1);
        } else {
            start = new Date(time1);
        }

        if (time2 === "") {
            time2 = initDate.getFullYear() + "-" + initDate.getMonth() + "-" + initDate.getDay();
            end = new Date();
        } else {
            end = new Date(time2);
        }

        var type = "全部";
        if (breedType === "1") {
            type = "猪";
        } else if (breedType === "2") {
            type = "牛";
        } else if (breedType === "3") {
            type = "羊";
        } else if (breedType === "4") {
            type = "家禽";
        }

        var href = "/getExcel/breed/document";

        if (breedType === "-1") {
            breedType = parseInt(breedType);
        } else {
            breedType = parseInt(breedType);
        }

        href = href + "/" + start + "/" + end + "/" + area + "/" + breedType;

        console.info(type);
        layui.use(['laypage', 'layer'], function () {

            var $ = layui.jquery, layer = layui.layer;
            layer.open({
                type: 2,
                title: '养殖档案报表',
                skin: 'layui-layer-lan',
                area: ['750px', '450px'],
                content: ['/djt/report/breedDocumentModel', 'no'],
                success: function (layero, index) {
                    var body = layer.getChildFrame('body', index);
                    var iframeWin = window[layero.find('iframe')[0]['name']];

                    body.find("#start").val(time1);
                    body.find("#end").val(time2);
                    body.find("#area").val(area);
                    body.find("#breedType").val(type);
                    body.find("#cancel").click(function () {
                        layer.close(index);
                    });
                    var a = body.find("#download");

                    a.attr("href", href);
                    a.click(function () {
                        layer.close(index);
                    });

                }
            })
        })
    }

    //生产
    function ShowOperatorProduction(cellvalue, options, rowObject) {
        var link;
        var productionInfo = JSON.stringify(rowObject["productionInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + productionInfo + "' onclick='getProductionInfo(this.id)'>查看</button>";
        return link;
    }

    function getProductionInfo(productionInfo) {

        var productionInfoO = JSON.parse(productionInfo);

        var sumBirthQuantity = 0;

        var sumChangeQuantity = 0;

        var sumDeathQuantity = 0;

        var sumInQuantity = 0;

        var sumOutQuantity = 0;

        if (productionInfoO) {
            sumBirthQuantity = productionInfoO.sumBirthQuantity;

            sumChangeQuantity = productionInfoO.sumChangeQuantity;

            sumDeathQuantity = productionInfoO.sumDeathQuantity;

            sumInQuantity = productionInfoO.sumInQuantity;

            sumOutQuantity = productionInfoO.sumOutQuantity;
        }


        layui.use(['laypage', 'layer'], function () {

            var $ = layui.jquery, layer = layui.layer;
            layer.open({
                type: 2,
                title: '生产记录汇总信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                content: ['/djt/report/productionReportInfo', 'no'],
                success: function (layero, index) {
                    var body = layer.getChildFrame('body', index);
                    var iframeWin = window[layero.find('iframe')[0]['name']];

                    body.find("#sumChangeQuantity").val(sumChangeQuantity);
                    body.find("#sumBirthQuantity").val(sumBirthQuantity);
                    body.find("#sumInQuantity").val(sumInQuantity);
                    body.find("#sumDeathQuantity").val(sumDeathQuantity);
                    body.find("#sumOutQuantity").val(sumOutQuantity);
                    body.find("#ok").click(function () {
                        layer.close(index);
                    });
                }
            })
        })
    }

    //饲料
    function ShowOperatorFeed(cellvalue, options, rowObject) {
        var link;
        var feedReportInfo = JSON.stringify(rowObject["feedReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + feedReportInfo + "' onclick='getFeedInfo(this.id)'>查看</button>";
        return link;
    }

    function getFeedInfo(feedReportInfo) {
        var feedReportInfoO = JSON.parse(feedReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";
        for (var i = 0; i < feedReportInfoO.length; i++) {
            var feedType = feedReportInfoO[i].feedType;
            var feedName = '其他';
            var sumUsedQuantity = feedReportInfoO[i].sumUsedQuantity;
            if (feedType === 1) {
                feedName = "猪饲料";
            } else if (feedType === 2) {
                feedName = "羊饲料";
            } else if (feedType === 3) {
                feedName = "鸡饲料";
            } else if (feedType === 4) {
                feedName = "鸭饲料";
            }
            if (!sumUsedQuantity) sumUsedQuantity = 0.00;

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label'>类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + feedName + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label'>用量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text' class='layui-input' placeholder='" + sumUsedQuantity + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";
            if (i !== feedReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }
        }

        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (feedReportInfoO && feedReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '饲料记录信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //原料
    function ShowOperatorMaterial(cellvalue, options, rowObject) {
        var link;
        var materialPurchaseReportInfo = JSON.stringify(rowObject["materialPurchaseReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + materialPurchaseReportInfo + "' onclick='getMaterialInfo(this.id)'>查看</button>";
        return link;
    }

    function getMaterialInfo(materialPurchaseReportInfo) {
        var materialPurchaseReportInfoO = JSON.parse(materialPurchaseReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < materialPurchaseReportInfoO.length; i++) {
            var productName = materialPurchaseReportInfoO[i].productName;
            var sumTotalPrice = materialPurchaseReportInfoO[i].sumTotalPrice;
            var avgPrice = materialPurchaseReportInfoO[i].avgPrice;
            var quantity = materialPurchaseReportInfoO[i].quantity;

            //todo productName 判断转化
            var productNameStr = "其它";
            if (productName === 1) {
                productNameStr = "玉米";
            } else if (productName === 2) {
                productNameStr = "豆粕";
            } else if (productName === 3) {
                productNameStr = "麸皮";
            } else if (productName === 4) {
                productNameStr = "鱼粉";
            } else if (productName === 5) {
                productNameStr = "其它";
            }

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + productNameStr + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>平均单价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + avgPrice + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  总价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text' class='layui-input' placeholder='" + sumTotalPrice + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== materialPurchaseReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (materialPurchaseReportInfoO && materialPurchaseReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '原料采购信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //药物购置
    function ShowOperatorDrugPurchase(cellvalue, options, rowObject) {
        var link;
        var drugPurchaseReportInfo = JSON.stringify(rowObject["drugPurchaseReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + drugPurchaseReportInfo + "' onclick='getDrugPurchaseInfo(this.id)'>查看</button>";
        return link;
    }

    function getDrugPurchaseInfo(drugPurchaseReportInfo) {
        var drugPurchaseReportInfoO = JSON.parse(drugPurchaseReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < drugPurchaseReportInfoO.length; i++) {
            var productName = drugPurchaseReportInfoO[i].productName;
            var sumTotalPrice = drugPurchaseReportInfoO[i].sumTotalPrice;
            var avgPrice = drugPurchaseReportInfoO[i].avgPrice;
            var quantity = drugPurchaseReportInfoO[i].quantity;

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + productName + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>平均单价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + avgPrice + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  总价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text' class='layui-input' placeholder='" + sumTotalPrice + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== drugPurchaseReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (drugPurchaseReportInfoO && drugPurchaseReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '药物采购信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //疫苗购置
    function ShowOperatorVaccineInfo(cellvalue, options, rowObject) {
        var link;
        var vaccinePurchaseReportInfo = JSON.stringify(rowObject["vaccinePurchaseReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + vaccinePurchaseReportInfo + "' onclick='getVaccinePurchaseInfo(this.id)'>查看</button>";
        return link;
    }

    function getVaccinePurchaseInfo(vaccinePurchaseReportInfo) {
        var vaccinePurchaseReportInfoO = JSON.parse(vaccinePurchaseReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < vaccinePurchaseReportInfoO.length; i++) {
            var productName = vaccinePurchaseReportInfoO[i].productName;
            var sumTotalPrice = vaccinePurchaseReportInfoO[i].sumTotalPrice;
            var avgPrice = vaccinePurchaseReportInfoO[i].avgPrice;
            var quantity = vaccinePurchaseReportInfoO[i].quantity;

            //todo productName 判断转化
            var productNameStr = "其他";
            $.ajax({

                url: "/get/find/by/code/vaccine",
                data: {code: productName, type: 2},
                dataType: "json",
                success: function (data) {
                    if (data !== null) {
                        console.info(data);
                        productNameStr = data.name;
                    } else if (data === null || data === undefined || data === '') {
                        console.info(data)
                        productNameStr = "其他";
                    }
                }
            });

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + productNameStr + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>平均单价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + avgPrice + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  总价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text' class='layui-input' placeholder='" + sumTotalPrice + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== vaccinePurchaseReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (vaccinePurchaseReportInfoO && vaccinePurchaseReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '疫苗采购信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //引种记录
    function ShowOperatorSeedPurchase(cellvalue, options, rowObject) {
        var link;
        var seedPurchaseReportInfo = JSON.stringify(rowObject["seedPurchaseReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + seedPurchaseReportInfo + "' onclick='getSeedPurchaseInfo(this.id)'>查看</button>";
        return link;
    }

    function getSeedPurchaseInfo(seedPurchaseReportInfo) {
        var seedPurchaseReportInfoO = JSON.parse(seedPurchaseReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < seedPurchaseReportInfoO.length; i++) {
            var productName = seedPurchaseReportInfoO[i].productName;
            var sumTotalPrice = seedPurchaseReportInfoO[i].sumTotalPrice;
            var avgPrice = seedPurchaseReportInfoO[i].avgPrice;
            var quantity = seedPurchaseReportInfoO[i].quantity;

            //todo productName 判断转化

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + productName + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>平均单价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + avgPrice + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  总价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text' class='layui-input' placeholder='" + sumTotalPrice + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== seedPurchaseReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (seedPurchaseReportInfoO && seedPurchaseReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '引种记录信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //其他购买
    function ShowOperatorOtherPurchase(cellvalue, options, rowObject) {
        var link;
        var otherPurchaseReportInfo = JSON.stringify(rowObject["otherPurchaseReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + otherPurchaseReportInfo + "' onclick='getOtherPurchaseInfo(this.id)'>查看</button>";
        return link;
    }

    function getOtherPurchaseInfo(otherPurchaseReportInfo) {
        var otherPurchaseReportInfoO = JSON.parse(otherPurchaseReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < otherPurchaseReportInfoO.length; i++) {
            var productName = otherPurchaseReportInfoO[i].productName;
            var sumTotalPrice = otherPurchaseReportInfoO[i].sumTotalPrice;
            var avgPrice = otherPurchaseReportInfoO[i].avgPrice;
            var quantity = otherPurchaseReportInfoO[i].quantity;

            //todo productName 判断转化

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + productName + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>平均单价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + avgPrice + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>  总价：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text' class='layui-input' placeholder='" + sumTotalPrice + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== otherPurchaseReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (otherPurchaseReportInfoO && otherPurchaseReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '其他采购信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //免疫记录信息
    function ShowOperatorImmunization(cellvalue, options, rowObject) {
        var link;
        var immunizationRecordInfo = JSON.stringify(rowObject["immunizationRecordInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + immunizationRecordInfo + "' onclick='getImmunizationInfo(this.id)'>查看</button>";
        return link;
    }

    function getImmunizationInfo(immunizationRecordInfo) {
        var immunizationRecordInfoO = JSON.parse(immunizationRecordInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < immunizationRecordInfoO.length; i++) {
            var vaccineCode = immunizationRecordInfoO[i].vaccineCode;
            var drugQuantity = immunizationRecordInfoO[i].drugQuantity;
            var quantity = immunizationRecordInfoO[i].quantity;

            var vaccineName = "其他"
            //todo productName 判断转化
            $.ajax({

                url: "/get/find/by/code/vaccine",
                data: {code: vaccineCode, type: 2},
                dataType: "json",
                success: function (data) {
                    if (data !== null) {
                        console.info(data);
                        vaccineName = data.name;
                    } else if (data === null || data === undefined || data === '') {
                        console.info(data)
                        vaccineName = "其他";
                    }
                }
            });

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>疫苗类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + vaccineName + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>免疫数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>用药量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + drugQuantity + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== immunizationRecordInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (immunizationRecordInfoO && immunizationRecordInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '免疫记录信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //消毒记录
    function ShowOperatorDisinfect(cellvalue, options, rowObject) {
        var link;
        var disinfectReportInfo = JSON.stringify(rowObject["disinfectReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + disinfectReportInfo + "' onclick='getDisinfectInfo(this.id)'>查看</button>";
        return link;
    }

    function getDisinfectInfo(disinfectReportInfo) {
        var disinfectReportInfoO = JSON.parse(disinfectReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < disinfectReportInfoO.length; i++) {
            var drugUsedQuantity = disinfectReportInfoO[i].drugUsedQuantity;
            var disinfectMethod = disinfectReportInfoO[i].disinfectMethod;

            //todo productName 判断转化
            var disinfectMethodStr = "其他";

            if (disinfectMethod === 1) {
                disinfectMethodStr = "喷雾";
            } else if (disinfectMethod === 2) {
                disinfectMethodStr = "其他";
            }

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>消毒方法：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + disinfectMethodStr + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>用药量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + drugUsedQuantity + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== disinfectReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (disinfectReportInfoO && disinfectReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: ' 消毒记录信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //诊疗记录
    function ShowOperatorDiagnosis(cellvalue, options, rowObject) {
        var link;
        var diagnosisReportInfo = JSON.stringify(rowObject["diagnosisReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + diagnosisReportInfo + "' onclick='getDiagnosisReportInfo(this.id)'>查看</button>";
        return link;
    }

    function getDiagnosisReportInfo(diagnosisReportInfo) {
        var diagnosisReportInfoO = JSON.parse(diagnosisReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < diagnosisReportInfoO.length; i++) {
            var illnessReason = diagnosisReportInfoO[i].illnessReason;
            var cases = diagnosisReportInfoO[i].cases;

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>疾病类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + illnessReason + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>发病数：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + cases + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== diagnosisReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (diagnosisReportInfoO && diagnosisReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '诊疗记录信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //检验检测
    function ShowOperatorImmunizationDetection(cellvalue, options, rowObject) {
        var link;
        var immunizationDetectionReportInfo = JSON.stringify(rowObject["immunizationDetectionReportInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + immunizationDetectionReportInfo + "' onclick='getImmunizationDetectionReportInfo(this.id)'>查看</button>";
        return link;
    }

    function getImmunizationDetectionReportInfo(immunizationDetectionReportInfo) {
        var immunizationDetectionReportInfoO = JSON.parse(immunizationDetectionReportInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < immunizationDetectionReportInfoO.length; i++) {
            var sampleType = immunizationDetectionReportInfoO[i].sampleType;
            var quantity = immunizationDetectionReportInfoO[i].quantity;

            //todo productName 判断转化
            var sampleTypeName = "其他"
            if (sampleType === 1) {
                sampleTypeName = "血样";
            } else if (sampleType === 2) {
                sampleTypeName = "尿样";
            } else if (sampleType === 3) {
                sampleTypeName = "奶样";
            } else if (sampleType === 4) {
                sampleTypeName = "蛋样";
            } else if (sampleType === 5) {
                sampleTypeName = "兽药";
            } else if (sampleType === 6) {
                sampleTypeName = "饲料";
            }

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>样本类型：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + sampleTypeName + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>检测数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== immunizationDetectionReportInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (immunizationDetectionReportInfoO && immunizationDetectionReportInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '检验检测信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    //防疫中心无害化
    function ShowOperatorQuantineHarmless(cellvalue, options, rowObject) {
        var link;
        var quarantineHarmlessInfo = JSON.stringify(rowObject["quarantineHarmlessInfo"]);

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + quarantineHarmlessInfo + "' onclick='getQuarantineHarmlessInfo(this.id)'>查看</button>";
        return link;
    }

    function getQuarantineHarmlessInfo(quarantineHarmlessInfo) {
        var quarantineHarmlessInfoO = JSON.parse(quarantineHarmlessInfo);

        var str = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>";

        for (var i = 0; i < quarantineHarmlessInfoO.length; i++) {
            var treatment = quarantineHarmlessInfoO[i].treatment;
            var quantity = quarantineHarmlessInfoO[i].quantity;

            //todo productName 判断转化
            var treatmentName = "其它";
            if (treatment === 1) {
                treatmentName = "集中处理";
            } else if (treatment === 2) {
                treatmentName = "焚烧";
            } else if (treatment === 3) {
                treatmentName = "化制";
            } else if (treatment === 4) {
                treatmentName = "深埋";
            } else if (treatment === 5) {
                treatmentName = "发酵";
            } else if (treatment === 6) {
                treatmentName = "其它";
            }

            str = str +
                "<div class='layui-form-item'> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>处理方式：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + treatmentName + "' readonly = 'readonly' /> " +
                "</div> </div> " +
                "<div class='layui-inline'> " +
                "<label class='layui-form-label' style='width: 120px'>数量：</label> " +
                "<div class='layui-input-inline'> " +
                "<input type='text'  class='layui-input' placeholder='" + quantity + "' readonly = 'readonly' /> " +
                "</div> </div> </div>";

            if (i !== quarantineHarmlessInfoO.length - 1) {
                str = str + "<hr class='layui-bg-blue'>";

            }

        }
        str = str + "</form>";

        layui.use(['laypage', 'layer'], function () {
            var content = '';
            var str1 = "<form class='layui-form' style='margin-top: 5%;margin-left: 5%'>" +
                "<label class='layui-form-label' style='width: auto'>暂无信息</label>" +
                "</form>";
            content = (quarantineHarmlessInfoO && quarantineHarmlessInfoO.length !== 0) ? str : str1;

            var $ = layui.jquery, layer = layui.layer;
            layer.alert(content, {
                title: '无害化信息',
                skin: 'layui-layer-lan',
                area: ['750px', '350px'],
                resize: true,
                closeBtn: 0
            })
        })
    }

    function ShowOperator(cellvalue, options, rowObject) {
        var link;
        var slaughterQuarantineCertNumber = rowObject["slaughterQuarantineCertNumber"];

        link = "<button type='button' class='btn btn-default' style='color: #2b85e4' id='" + slaughterQuarantineCertNumber + "' onclick='getCert(this.id)'>查看</button>";
        return link;
    }

</script>


</body>
</html>
